<div class="content blog">
    <ul class="breadcrumb">
        <li><a href="index.php?r=blog">博客管理</a></li>
        <li class="active">我的博客</li>
    </ul>
    <div class="row-fluid">
        <div class="page-header">
            <button class="btn btn-success addblog"><i class="glyphicon glyphicon-plus"></i>发表博客</button>
        </div>
        <div class="table-responsive blogs">
            <table class="table table-striped table-bordered">
                <thead>
                    <tr>
                      <th class="text-center" width="5%">#</th>
                      <th width="70%" >标题</th>
                      <th width="10%">创建时间</th>
                      <th width="15%">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                        $i = 1;
                        foreach ($ret as $key=>$value) {
                    ?>
                    <tr>
                      <td class="text-center" scope="row"><?= $i++; ?></td>
                      <td><?= $value['title']?></td>
                      <td><?= $value['addtime']?></td>
                      <td>
                          <a href="index.php?r=blog/edit&aid=<?= $value['aid']?>" class="btn btn-sm btn-success"><i class="glyphicon glyphicon-pencil"></i>编辑</a>
                          <a href="index.php?r=blog/delete&aid=<?= $value['aid']?>" class="btn btn-sm btn-danger"><i class="glyphicon glyphicon-remove"></i>删除</a>
                      </td>
                    </tr>
                    <?php } ?>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $(".addblog").on('click',function() {
            window.location.href="index.php?r=blog/create";
        });
    });
</script>
